const bcServiceObject = (request) => {
	return {
		// 详情
		view_bcServiceObject_view(id) {
			return request(`/blockchain/bcServiceObject/${id}`, {
				method: 'get',
			})
		},
		// 获取列表
		view_bcServiceObject_page(query = {}) {
			return request('/bussiness/bcServiceObject/page', {
				method: 'post',
				data: query,
			})
		},
		// 获取变更数据
		view_blockchain_changeRecord(query = {}) {
			return request('/bussiness/blockchainGeneral/changeRecord', {
				// return request('/blockchain/bcServiceObject/blockchain/changeRecord', {
				method: 'post',
				data: {
					...query
				},
			})
		},
		// 获取上链接信息(基础数据库使用)
		view_bcServiceObject_view_blockchain(id) {
			return request(`/blockchainbackup/bcServiceObject/queryBlockchainInfo`, {
				method: 'post',
				data: {
					code: 1001,
					key: id,
				},
			})
		},
		//查询链上信息 （除服务对象，其他地方通用接口(只用于指静脉)，权限为（view_bcIccPunchRecord_queryBlockchainInfo）
		view_bcIccPunchRecord_queryBlockchainInfo: (query: { code: number; key: string }) => {
			// 原 /blockchainbackup/bcIccPunchRecord/queryBlockchainInfo
			return request('/bussiness/blockchainGeneral/queryBlockchainInfo', {
				method: 'post',
				data: {
					code: query.code,
					key: query.key,
				},
			})
		},
		// 通过链接id得到上链接信息（通用，不适用于指静脉），权限为（view_blockchainBackupGeneral_queryBlockchainInfo）
		view_blockchainBackupGeneral_queryBlockchainInfo(query = {}){
			return request('/bussiness/blockchainGeneral/queryBlockchainInfo', {
				method: 'post',
				data: query,
			})
		}
	}
}
const bcServiceOrgBase = (request) => {
	return {
		// 获取列表养老机构
		view_bcServiceOrgBase_page(query = {}) {
			return request('/bussiness/bcServiceOrgBase/page', {
				method: 'post',
				data: query,
			})
		},
		// 获取从业人员列表
		view_bcFoundationPractitioners_page(query = {}) {
			return request('/bussiness/bcFoundationPractitioners/page', {
				method: 'post',
				data: query,
			})
		},
		// 养老服务组织列表
		view_bcServiceOrgHome_page(query = {}) {
			return request('/bussiness/bcServiceOrgHome/page', {
				method: 'post',
				data: query,
			})
		},
		// 获取养老设施列表
		view_bcServiceFacility_page(query = {}) {
			return request('/bussiness/bcServiceFacility/page', {
				method: 'post',
				data: query,
			})
		}
	}
}
export default ({ request }: any) => ({
	...bcServiceObject(request),
	...bcServiceOrgBase(request),
})
